package controllers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import model.CustomerHistoryModel;
import model.User;
import view.AcceptOrRejectGui;
import view.FinalAccOrRejGui;

public class AcceptOrRejectController extends AbstractTransfer{

	
	private SalesManControllers salesCon = null;
	private AcceptOrRejectController currCon =null;
	private AcceptOrRejectGui accoregGui = null;
	private User customerBuy = null;
	private String CampID = "";
	private String CurrDate = "";
	private CustomerHistoryModel cchist = null;
	
	public AcceptOrRejectController(User u, AcceptOrRejectGui g,SalesManControllers bac,String Cam ,String CurD)
	{
		super();
		System.out.println("sadasdsadsada");
	   currCon = this;
	   accoregGui=g;
	   salesCon = bac;
	   	customerBuy = u;

	   	accoregGui.setLblNameCust(u.getFirstname()+" "+u.getLasttname());
    	accoregGui.setLblIDCust(u.getUid());
	

		CampID = Cam;
		CurrDate = CurD;
		
		accoregGui.addMainMenubtnAC(new MainMenuAC());
		accoregGui.addAcceptBtnAC(new Acceptance());
		accoregGui.addRejectBtnAC(new Rejectance());
		
		
	}
	
	class Acceptance implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			accoregGui.dispose();
			FinalAccOrRejGui fingui = new FinalAccOrRejGui(0);
			FinalAccOrRejController FinCon = new FinalAccOrRejController(salesCon,fingui, CampID,CurrDate,customerBuy.getUid());
		}
	}

	
	class Rejectance implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			accoregGui.dispose();
			FinalAccOrRejGui fingui = new FinalAccOrRejGui(1);
			FinalAccOrRejController FinCon = new FinalAccOrRejController(salesCon,fingui, CampID,CurrDate,customerBuy.getUid());
		}
		
		
		
	}
	
	
	class MainMenuAC implements ActionListener
	{

		@Override
		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			accoregGui.dispose();
			salesCon.GetSalesManGui().setVisible(true);
		}
	}
	
	
	

	
	
}
